		//打印控件调用
		var LODOP; //声明为全局变量 
		var p_id="";
		//返回	
		function fanhui(){
			$("#certNumber").val("");
			$("#name").html("");
			$("#sex").html("");
			$("#nation_").html("");
			$("#birthday").html("");
			$("#address").html("");
			$("#idcard").html("");
			$("#banum").val("");
			$("#phone").val("");
			$("#header_name_pay").html("");
			$("#validation").val("");
			$("#choice").val("");
			$("#crdiv").attr("class","modal_ modal");
			$("#sfzdiv").attr("class","modal_1 modal  hide");
			$("#div_key").attr("class","modal_key modal hide");	 
		}
		
		//刻录光盘复制图片
		function copyBanum(){
			var orgcode=$("#orgcode").val();
			var idcard=$("#idcard_").val();
			var basepath=$("#basepath").val();
			var obj=$("[name='dvd_checkbox'][checked]");
			check_val = [];
			var onlyIds='';
		    for(k in obj){
		        if(obj[k].checked){
			            check_val.push(obj[k].value);
			            onlyIds+=","+obj[k].value;
		            }
		    }
		    //没选择弹窗提示
		    if(check_val.length==0){
		    	 $(document.body).append("<div class='alert fade in alert_warn'><button type='button' id='btn_warn' onclick='close_warn()' class='close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>请选择病案后刻录!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
			     settime_warn($("#btn_warn"));
		    	return false;
		    }
   			//alert(check_val);
			var path="f:/test";
			//progress_dvd(1);
			 $.ajax({  
			                    type:"POST",  
			                    url:basepath+"/spmr/copyBanumByOnlyId",  
			                    dataType:"json",  
			                    data:{onlyIds:onlyIds,orgcode:orgcode,filePath:path},
			                    success:function(data){
			                    	if (typeof (data) == "string"){
			                    		var param=data;
			                    		if(param=='success'){
			                    			//alert("复制完成");
			                    		}else{
			                    			$("#bar_dvd_close").remove();
			                    			$(document.body).append("<div class='alert fade in alert_warn'><button type='button' id='btn_warn' onclick='close_warn()' class='close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>请重新读取身份证或到人工窗口办理!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
			                        		settime_warn($("#btn_warn"));
			                    		}
			                    		
			                    	}
			                    	
			                    },  
			                    error:function(){  
			                    		$("#bar_dvd_close").remove();
			                            $(document.body).append("<div class='alert fade in alert_warn'><button type='button' id='btn_warn' onclick='close_warn()' class='close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>请重新读取身份证或到人工窗口办理!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
			                        	settime_warn($("#btn_warn"));
			                        	
			                        }
			      	});  
		}
	
	function myPrint() {
			var orgcode=$("#orgcode").val();
			var onlyId=$("[name='banum_checkbox'][checked]").val();
			var combinationContent=$("[name='combination_checkbox'][checked]").val();
			var fs=$("#input_fs").val();
			var basepath=$("#basepath").val();
			if(onlyId==undefined){
				//$("#myModal").append("<div class='alert fade in alert_warn_'><div class='warn_div'><font class='font9' id='warn'>请选择病案!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
				$(".btn_fs").attr("disabled",true);
				$("#myModal").append("<div class='alert_warn_banum modal'  onclick='closeBanum()'><div class='warn_div_banum'><font class='font12' id='warn'>请选择病案!</font></div></div>");
				//$(".btn_fs").attr("disabled",true);
				settime_banum($(".alert_warn_banum"),5);
				//settime_warn($("#btn_warn"));
			}else if(combinationContent==undefined){
				$("#myModal").append("<div class='alert fade in alert_warn_'><button type='button' id='btn_warn' onclick='close_warn()' class='modal_close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>请选择病案用途!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
				$(".btn_fs").attr("disabled",true);
				settime_warn($("#btn_warn"));
			}else{
				$(".btn_fs").attr("disabled",true);
				var	speed=1;

				var check=$('input[id^=banum_checkbox_]:checked');
	          	            //意思是选择被选中的checkbox
				if(check.length>1){
					choice_print(combinationContent,orgcode);
				}else{
					 
					$.ajax({
				                    type:"POST",  
				                    url:basepath+"/spmr/findImg",
				                    dataType:"json",
				                    data:{onlyId:onlyId,combinationContent:combinationContent,orgcode:orgcode},
				                    success:function(data){
				                   	   
				                    	var num=data.length;
				                    	if(data.length>0){
				                    		$(".alert_warn_").remove();
				            				//$("#myModal").append("<div class='alert fade in alert_warn_' id='dy_alert'><div class='warn_div'><font class='font9' id='warn'>请稍后，正在调取病案...</div></div>");
				            				$("#myModal").append("<div class='alert_warn_new modal' id='dy_alert'><div class='warn_div_dq'><font class='font12' id='warn'>请稍后，正在调取病案...</font></div></div>");

				            				$("#dy_alert").append("<div class='alert fade in bar_warn warn_dq' id='bar_close'><div  class='progress progress-striped active'><div class='bar' id='bar_dy' style='width: 1%;'></div></div></div>");
				            				settime_progress($("#dy_alert"),30);
				            				progress_bar_dq(2,1);
				                    		//进度条开启 
					        				//progress_bar(speed);
					                    	//灯带亮start
					        			    var obj = document.getElementById("LedObj");
					        			    if (obj.object==null)
					        				{
					        			        alert("插件未安装！");
					        			    }
					        			   
					        				try{
					        					obj.LedStartFlash(1);
					        			     }catch (e){
					        			         //   alert(e.message);
					        			     }
					        				//灯带亮end
	
					        			    My_Print(data);
				                    		getDyStateNum(num,fs,data,fs);

					        			     
					                    }else{

					                    	$("#myModal").append("<div class='alert fade in alert_warn_'><button type='button' id='btn_warn' onclick='close_warn()' class='modal_close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>病案暂未扫描，请咨询人工窗口！</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>20</font></div></div>");
					                    	$(".btn_fs").attr("disabled",true);
											settime_down($("#btn_warn"),20);
											setTimeout("window.location.reload()",20000);
					                    }
				                    	
				                    	
						                 
					                   // setTimeout("close_war()",8000+1000*num*fs);
				                    },  
				                    error:function(){  
				                    		$("#myModal").append("<div class='alert fade in alert_warn'><button type='button' id='btn_warn' onclick='close_warn()' class='modal_close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>请重新读取身份证或到人工窗口办理!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
				                        	settime_warn($("#btn_warn"));
				                        }
				                     });  
					
				}
		  }		
	
		};	
		
		function choice_print(combinationContent,orgcode){
			var check_id;
			var onlyId;
			var check=$('input[id^=banum_checkbox_]:checked');
			var basepath=$("#basepath").val();
			var fs=$("#input_fs").val();
			var speed=0.5;
			if(check.length>0){
				$.each(check,function(){
					onlyId=$(this).val();
					check_id=$(this).attr("id");
					var trid_=check_id.split("_")[1]+"_"+check_id.split("_")[0]+"_"+check_id.split("_")[2];
					$("#"+trid_).removeAttr("onclick"); 
				});
				if(check_id){
					var trid=check_id.split("_")[1]+"_"+check_id.split("_")[0]+"_"+check_id.split("_")[2];
					$("#"+trid).attr("style","background:rgba(199, 221, 239, 1)");
					var tdid_=check_id.split("_")[0]+"_td_"+check_id.split("_")[2];
					$("#"+tdid_).html("<font style='font-size:16px;color:rgba(242, 92, 39, 1)'>正在打印</font>"); 
					//var TRX = $("#"+trid).offset().top+10;
					//var TRY = $("#"+trid).offset().left+800;
					//$(document.body).append("<div id='span_"+trid+"' class='span_div' style='position:absolute; top:"+TRX+"px;left:"+TRY+"px;font-size:16px;color:rgba(242, 92, 39, 1);'>打印中。。。</div>");

					//alert("x:"+X+";y:"+Y+";TRX:"+TRX+";TRY:"+TRY);
				}
				

				$("#"+check_id).prop("checked",false);
				$("#"+check_id).attr("checked",false);
				$("#"+check_id).attr("disabled", true);
				$.ajax({
	                type:"POST",  
	                url:basepath+"/spmr/findImg",
	                dataType:"json",  
	                data:{onlyId:onlyId,combinationContent:combinationContent,orgcode:orgcode},
	                success:function(data){
	               	   
	                	var num=data.length;
	                	if(data.length>0){

                    		
	                		$("#dy_alert").remove();
             				$("#myModal").append("<div class='alert_warn_new modal' id='dy_alert'><div class='warn_div_dq'><font class='font12' id='warn'>请稍后，正在调取病案...</font></div></div>");

            				$("#dy_alert").append("<div class='alert fade in bar_warn warn_dq' id='bar_close'><div  class='progress progress-striped active'><div class='bar' id='bar_dy' style='width: 1%;'></div></div></div>");
            				settime_progress($("#dy_alert"),30);
            				progress_bar_dq(2,1);
	                    	//灯带亮start
	        			    var obj = document.getElementById("LedObj");
	        			    if (obj.object==null)
	        				{
	        			        alert("插件未安装！");
	        			    }
	        			   
	        				try{
	        					obj.LedStartFlash(1);
	        			     }catch (e){
	        			         //   alert(e.message);
	        			     }
	        				//灯带亮end
	                		for(var i=0;i<fs;i++){
	                			//progress_bar_(speed,fs,i+1);
	                			if(fs>1){
		                    		//$("#bar_font").html("正在打印第"+(i+1)+"份，请稍后！");	
	                			}
		                    		
	                			//打印
	                			My_Print(data);
		                    		// progress_bar(speed);
		                    }
	                		getDyStatefs(num,fs,combinationContent,orgcode,trid);

	                    }else{
	                    	
	                    	$(document.body).append("<div class='alert fade in alert_warn_'><button type='button' id='btn_warn' onclick='close_warn()' class='close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>标识码为:"+onlyId+"病案暂未扫描，请咨询人工窗口！</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
							$(".btn_fs").attr("disabled",true);
							settime_warn($("#btn_warn"));
							$("#span_"+trid).html("该病案未扫描，暂无法打印！");
							$.ajax({  
			                    type:"POST",  
			                    url:basepath+"/spmr/getDelay",  
			                    dataType:"json",  
			                    data:{delay:5000},
			                    success:function(data){
			                    		
			                    		getDyStatefs(num,fs,combinationContent,orgcode,"");
			                    }
			                 });
							
	                    }
	                	
	                	
		                 
	                   // setTimeout("close_war()",8000+1000*num*fs);
	                },  
	                error:function(){  
	                        $(document.body).append("<div class='alert fade in alert_warn'><button type='button' id='btn_warn' onclick='close_warn()' class='close'>&times;</button><div class='warn_div'><font class='font9' id='warn'>请重新读取身份证或到人工窗口办理!</font></div>	<div class='warn_div_'><font class='font5' id='warn_'>5</font></div></div>");
	                    	settime_warn($("#btn_warn"));
	                    }
	                 });  
			}else{
				if($("#choiceWarn").length > 0){
					$("#choiceWarn").remove();
				}
				setTimeout(closeWindow(),8000);
			}
			
		}
		
		//查看打印最后任务是否完成	
		function getDyStatefs(num,fs,combinationContent,orgcode,trid){
			var basepath=$("#basepath").val();

			if(p_id!=''&&p_id!= undefined){
				
				var flag=true;
	        	var state=getStatusValue('PRINT_STATUS_EXIST',p_id,'');
	        	var status=getStatusValue('PRINT_STATUS_ID',p_id,'');
	        	var sta=getStatusValue('PRINT_STATUS_TEXT',p_id,'');
	        	//	$("#bjtp").val("1:"+p_id+";"+k+";"+state+";"+status+";"+sta);
	        	//alert(state+";打印机状态："+status);
	        	if(state==1){
	        		if(status==8272){
	        			alert("打印机缺纸，请联系工作人员!");
	        		}
					if(status==8210){
						alert("打印机故障，请联系工作人员!");
					}
					flag= true;
				}else{
					flag= false;
				}
	        	if(flag){
	        		$.ajax({  
	                    type:"POST",  
	                    url:basepath+"/spmr/getDelay",  
	                    dataType:"json",  
	                    data:{delay:2000},
	                    success:function(data){
	                    		getDyStatefs(num,fs,combinationContent,orgcode,trid);
	                    }
	                 });	
	        	}else{
					if($("#choiceWarn").length > 0){
						$("#choiceWarn").remove();
					}
					if(trid!=""){
						//var trid_=trid.split("_")[1]+"_"+trid.split("_")[0]+"_"+trid.split("_")[2];
						var onlyId=$("#"+trid).attr("onlyId");
						//$("#myModal").append("<div class='alert fade in alert_warn_' id='choiceWarn'><div class='warn_div'><font class='font17' id='warn'>标识码为："+onlyId+"的病案，打印完成请装订！</font></div>	<div class='warn_div_'><font class='font5' id='warn_'></font></div></div>");

		        		$("#"+trid).attr("style","");
		        		var tdid_=trid.split("_")[1]+"_td_"+trid.split("_")[2];
						$("#"+tdid_).html("<font style='font-size:16px;color:rgba(242, 92, 39, 1)'>打印完成</font>"); 
		        		//$("#span_"+trid).html("打印完成！");
						
					}
					
	        		choice_print(combinationContent,orgcode);
	        		/*$.ajax({  
	                    type:"POST",  
	                    url:basepath+"/spmr/getDelay",  
	                    dataType:"json",  
	                    data:{delay:100*num*fs},
	                    success:function(data){
	                    	closeWindow();
	                    }
	                 });	*/
	        		
	        	}
		        	
			}else{
				setTimeout(closeWindow(),8000+1000*num*fs);
			}
		}
		
		function My_Print(data){
			//var docPath=$("#docPath").val();
			var basepath=$("#basepath").val();
			var docPath="http://11.0.0.55:9085/MrDoc/";
        	LODOP=getLodop();
			LODOP.PRINT_INIT("自助打印");
			LODOP.SET_PRINT_PAGESIZE(1, 0,0,"A4");
			var date=new Date();
			var month=date.getMonth()+1;
			var strDate=date.getDate();
			var year=date.getFullYear();
			var hour=date.getHours();
			var minute=date.getMinutes();
			var second=date.getSeconds();
			if(month>=1&&month<=9){
				month="0"+month;
			}		
			if(strDate>=0&&strDate<=9){
				strDate="0"+strDate;
			}
			if(hour>=0&&hour<10){
				hour="0"+hour;
			}
			if(minute>=0&&minute<10){
				minute="0"+minute;
			}
			if(second>=0&&second<10){
				second="0"+second;
			}
			var currentday=year+"-"+month+"-"+strDate+" "+date.getHours()+":"+minute+":"+second+"     自助打印";
			if(data.length<60){
				for(var p in data){ 
	        		
		        		var fileName=data[p].fileName;
		    			var path;
			        	if(fileName.indexOf("jpg") >= 0){
			        		path="<img border='0' src='"+docPath+data[p].organizationId+"/source"+data[p].recordPath+"/"+fileName+"' >";
			        	}else{
			        		fileName=fileName.replace("tif","png");
			        		path="<img border='0' src='"+docPath+data[p].organizationId+"/thumbnail_"+data[p].recordPath+"/"+fileName+"' >";
			        	}
		        		//var fileName=data[p].fileName.replace("tif","png");
						//setTimeout("",100);
		        		//var path="D:"+data[p].sysPath+"/"+data[p].organizationId+"/thumbnail_"+data[p].recordPath+"/"+fileName;
		        		//LODOP.ADD_PRINT_IMAGE(0,0,"100%","100%","<img style='width:810px;height:1105px;' src='"+path+"'  /> ");
		
			        	LODOP.ADD_PRINT_IMAGE(0,0,"100%","100%",path);
						LODOP.SET_PRINT_STYLEA(0,"Stretch",2);//按原图比例(不变形)缩放模式
			        //	setTimeout("function(){}",500);
		           		LODOP.ADD_PRINT_HTM(0,0,"80%","80%","<img border='0' transcolor='#FFFFFF' src='"+basepath+"/img/slyy_.png' style='position: absolute; z-index: -1;left:210px;top:100px;width:130px;height:130px;' />   ");
		           		LODOP.SET_PRINT_STYLE("FontColor","rgba(255, 0, 0, 1)");
						LODOP.SET_PRINT_STYLE("FontSize",14);
						LODOP.ADD_PRINT_TEXT(23,70,408,30,currentday);
			        	//setTimeout("function(){}",500);
		           		//LODOP.ADD_PRINT_HTM(0,0,"100%","100%","<img style="width:100%;height:100%;" src='<%=scanPath%>"+data[p].sysPath+data[p].organizationId+data[p].recordPath+"/source/"+data[p].fileName+"'  /><img border='0' transcolor='#FFFFFF' src='E:/2.png' style='z-index: -1; position: absolute; left:100px; top:15px;' />   ");
		        		//打印原版图片
		        	//	LODOP.ADD_PRINT_HTM(0,0,"100%","100%","<img  src='"+path+"'  /><img border='0' transcolor='#FFFFFF' src='E:/2.png' style='z-index: -1; position: absolute; left:100px; top:15px;' />   ");
		        		LODOP.NEWPAGE();
		            	LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
	        		
	            	
	            	//alert(p_id);
	            	//getDyState(p_id);
	        	}
				p_id=LODOP.PRINT();
			}else{
				var num=Math.ceil(data.length/60);
				if(num>1){
					p_id=LODOP.PRINT();
					$("#myModal").append("<div class='alert_warn_banum modal'  onclick='closeBanum()'><div class='warn_div_banum'><font class='font12' id='warn'>该病案不能打印！</font></div></div>");
					settime_banum($(".alert_warn_banum"),5);
				}else{
					for(var i=0;i<num;i++){
						var length=(i+1)*60;
						if(length>data.length){
							length=data.length;
						}
						for(var j=i*60;j<length;j++){ 
				        	
			        		var fileName=data[j].fileName;
			    			var path;
				        	if(fileName.indexOf("jpg") >= 0){
				        		path="<img border='0' src='"+docPath+data[j].organizationId+"/source"+data[j].recordPath+"/"+fileName+"' >";
				        	}else{
				        		fileName=fileName.replace("tif","png");
				        		path="<img border='0' src='"+docPath+data[j].organizationId+"/thumbnail_"+data[j].recordPath+"/"+fileName+"' >";
				        	}
			        		//var fileName=data[p].fileName.replace("tif","png");
							//setTimeout("",100);
			        		//var path="D:"+data[p].sysPath+"/"+data[p].organizationId+"/thumbnail_"+data[p].recordPath+"/"+fileName;
			        		//LODOP.ADD_PRINT_IMAGE(0,0,"100%","100%","<img style='width:810px;height:1105px;' src='"+path+"'  /> ");
			
				        	LODOP.ADD_PRINT_IMAGE(0,0,"100%","100%",path);
							LODOP.SET_PRINT_STYLEA(0,"Stretch",2);//按原图比例(不变形)缩放模式
				        //	setTimeout("function(){}",500);
			           		LODOP.ADD_PRINT_HTM(0,0,"80%","80%","<img border='0' transcolor='#FFFFFF' src='"+basepath+"/img/slyy_.png' style='position: absolute; z-index: -1;left:210px;top:100px;width:130px;height:130px;' />   ");
			           		LODOP.SET_PRINT_STYLE("FontColor","rgba(255, 0, 0, 1)");
							LODOP.SET_PRINT_STYLE("FontSize",14);
							LODOP.ADD_PRINT_TEXT(23,70,408,30,currentday);
				        	//setTimeout("function(){}",500);
			           		//LODOP.ADD_PRINT_HTM(0,0,"100%","100%","<img style="width:100%;height:100%;" src='<%=scanPath%>"+data[p].sysPath+data[p].organizationId+data[p].recordPath+"/source/"+data[p].fileName+"'  /><img border='0' transcolor='#FFFFFF' src='E:/2.png' style='z-index: -1; position: absolute; left:100px; top:15px;' />   ");
			        		//打印原版图片
			        	//	LODOP.ADD_PRINT_HTM(0,0,"100%","100%","<img  src='"+path+"'  /><img border='0' transcolor='#FFFFFF' src='E:/2.png' style='z-index: -1; position: absolute; left:100px; top:15px;' />   ");
			        		LODOP.NEWPAGE();
			            	LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
		        		}
		            	
		            	//alert(p_id);
		            	//getDyState(p_id);
			        	
						p_id=LODOP.PRINT();
					}
				}	
			}
			
		}
		
		
		function getDyStateNum(num,fs,data,current){
			var basepath=$("#basepath").val();
			
			if(p_id!=''&&p_id!= undefined){
				
				var flag=true;
		        
		        	var state=getStatusValue('PRINT_STATUS_EXIST',p_id,'');
		        	var status=getStatusValue('PRINT_STATUS_ID',p_id,'');
		        	var sta=getStatusValue('PRINT_STATUS_TEXT',p_id,'');
		        
		        	//alert(state+";打印机状态："+status);
		        	if(state==1){
		        		if(status==8272){
		        			alert("打印机缺纸，请联系工作人员!");
		        		}
						if(status==8210){
							alert("打印机故障，请联系工作人员!");
						}
						flag= true;
					}else{
						flag= false;
					}
		        	if(flag){
		                   
		                   $.ajax({  
			                    type:"POST",  
			                    url:basepath+"/spmr/getDelay",  
			                    dataType:"json",  
			                    data:{delay:2000},
			                    success:function(data1){
			                    	getDyStateNum(num,fs,data,current);
			                    }
			                 });	
		        	}else{
	
		        		current=current-1;
		        		if(current!=0){
							if($("#choiceWarn").length > 0){
								$("#choiceWarn").remove();
							}
							$("#myModal").append("<div class='alert fade in alert_warn_' id='choiceWarn'><div class='warn_div'><font class='font9' id='warn'>第"+(fs-current)+"份病案，打印完成请装订！</font></div>	<div class='warn_div_'><font class='font5' id='warn_'></font></div></div>");

		        			$("#bar_font").html("正在打印第"+(fs-current+1)+"份，请稍后！");
		        			My_Print(data);
		        			getDyStateNum(num,fs,data,current);
		        		}else{
		        			$.ajax({  
			                    type:"POST",  
			                    url:basepath+"/spmr/getDelay",  
			                    dataType:"json",  
			                    data:{delay:100*num*fs},
			                    success:function(data){
			                    	closeWindow();
			                    }
			                 });	
		        		}
		        		
		        	}
		        	
			}else{
				setTimeout(closeWindow(),8000+1000*num*fs);
			}
		}
		
		
		
		var k=0;
	//查看打印最后任务是否完成	
		function getDyState(num,fs){
			var basepath=$("#basepath").val();
			k++;
			if(p_id!=''&&p_id!= undefined){
				
				var flag=true;
		        
	        	var state=getStatusValue('PRINT_STATUS_EXIST',p_id,'');
	        	var status=getStatusValue('PRINT_STATUS_ID',p_id,'');
	        	var sta=getStatusValue('PRINT_STATUS_TEXT',p_id,'');
	        	$("#bjtp").val("1:"+p_id+";"+k+";"+state+";"+status+";"+sta);
	        	//alert(state+";打印机状态："+status);
	        	if(state==1){
	        		if(status==8272){
	        			alert("打印机缺纸，请联系工作人员!");
	        		}
					if(status==8210){
						alert("打印机故障，请联系工作人员!");
					}
					flag= true;
				}else{
					flag= false;
				}
	        	if(flag){
	        		$.ajax({  
	                    type:"POST",  
	                    url:basepath+"/spmr/getDelay",  
	                    dataType:"json",  
	                    data:{delay:2000},
	                    success:function(data){
	                    		getDyState(num,fs);
	                    }
	                 });	
	        	}else{
	        		$.ajax({  
	                    type:"POST",  
	                    url:basepath+"/spmr/getDelay",  
	                    dataType:"json",  
	                    data:{delay:100*num*fs},
	                    success:function(data){
	                    	closeWindow();
	                    }
	                 });	
	        		
	        	}
		        	
			}else{
				setTimeout(closeWindow(),8000+1000*num*fs);
			}
		}
		
		function closeBanum(){
			settime_banum($(".alert_warn_banum"),0);
		}


		function closeWindow(){
				if($("#choiceWarn").length > 0){
					$("#choiceWarn").remove();
				}
        		$("#bar_font").html("打印即将完成，请稍后！");	
            	$("#bar_close").remove();
        		//关灯start
            	var obj = document.getElementById("LedObj");
                try
        		{
                    obj.LedStopFlash(1);
                }
                catch (e)
        		{
                   // alert(e.message);
                }
                //关灯end
                close_war();
        		
		}
		
	//查看打印状态	
		function getStatusValue(ValueType,ValueIndex,oResultOB){
			LODOP=getLodop(); 
			if (LODOP.CVERSION) 
				LODOP.On_Return=function(TaskID,Value){oResultOB.value=Value;};
			var strResult=LODOP.GET_VALUE(ValueType,ValueIndex);
			if (!LODOP.CVERSION)
				return strResult; 
			else return "";
		};